import React from 'react';
import TjTable from '@/pages/ETrade/components/TjTable';
import './index.less';

const LogContent: React.FC<ILogContentProps> = (props) => {
  return (
    <div className="log-content">
      {props.data.type == '编辑' ? (
        <div className="table-box">
          <TjTable
            columns={[
              {
                name: '-',
                code: 'source',
                width: 80,
                align: 'center',
                lock: true,
                render: (value, row, index) => {
                  return index === 0 ? '原始内容' : '操作内容';
                },
              },
              { name: '场站名称', code: 'stationName', align: 'center', width: 150, lock: true },
              { name: '尖峰', code: 'peakSpike', align: 'center', width: 100 },
              { name: '高峰', code: 'peak', align: 'center', width: 100 },
              { name: '平段', code: 'flatPeriod', align: 'center', width: 100 },
              { name: '低谷', code: 'lowValley', align: 'center', width: 100 },
              { name: '深谷', code: 'deepValley', align: 'center', width: 100 },
            ]}
            dataSource={props.data.dataList}
          />
        </div>
      ) : (
        <div className="str">{props.data.content}</div>
      )}
    </div>
  );
};

interface ILogContentProps {
  data: any;
}

export default LogContent;
